{extend name="base" /}
{block name="main"}
<div class="l-loading" style="display: block" id="htr-loading"></div>
<form id='editFrom' autocomplete='off'>
<input type='hidden' id='stockId' class='ipt' value="{$object['stockId']}"/>
<table class='htr-form htr-box-top'>
  {if $object['stockId']}
  <input type='hidden' id='shopId' class='ipt' value="{$object['shopId']}"/>
  <input type='hidden' id='goodsId' class='ipt' value="{$object['goodsId']}"/>
  <tr>
     <th width='150'>店铺名称<font color='red'>*</font>：</th>
     <td>{$shop['shopName']} - ({$shop['shopSn']})</td>
  </tr>
  <tr>
     <th>商品名称<font color='red'>*</font>：</th>
     <td>{$goods['goodsName']} - ({$goods['goodsSn']})</td>
  </tr>
  {else}
  {if $shopId}
  <input type='hidden' id='shopId' class='ipt' value="{$shopId}"/>
  <tr>
     <th width='150'>店铺名称<font color='red'>*</font>：</th>
     <td>{$shop['shopName']} - ({$shop['shopSn']})</td>
  </tr>
  {else}
  <tr>
     <th width='150'>店铺名称<font color='red'>*</font>：</th>
     <td>      
      <select id="shopId" name='shopId' class='ipt'>
        <option value="">-请选择-</option>     
        {volist name="shopList" id="vo"}
        <option value="{$vo['shopId']}"{if $vo['shopId']==$shopId} selected{/if}>{$vo['shopName']} - ({$vo['shopSn']})</option>
        {/volist}
      </select>
    </td>
  </tr>
  {/if}
  <tr>
     <th>商品名称<font color='red'>*</font>：</th>
     <td>
      <select id="goodsId" name='goodsId' class='ipt'>
        <option value="">-请选择-</option>  
        {volist name="goodsList" id="vo"}
        <option value="{$vo['goodsId']}"{if $vo['goodsId']==$object['goodsId']} selected{/if}>{$vo['goodsName']} - ({$vo['goodsSn']})</option>
        {/volist}
      </select>
    </td>
  </tr>
  {/if}
  <!-- <tr>
     <th>库存数量<font color='red'>*</font>：</th>
     <td><input type="text" id='goodsStock' class='ipt' value="{$object['goodsStock']}" maxLength='20' data-rule="库存数量: required"/></td>
  </tr> -->
  <tr>
     <th>缺货警告<font color='red'>*</font>：</th>
     <td><input type="text" id='cautionNum' class='ipt' value="{$object['cautionNum']}" maxLength='20' data-rule="缺货警告: required"/></td>
  </tr>
  <tr>
     <td colspan='2' align='center'>
       <input type='button' value='保存' class='btn btn-blue' onclick='javascript:save()'>
       <input type='button' value='返回' class='btn' onclick='javascript:history.go(-1)'>
     </td>
  </tr>
</table>
</form>
{/block}
{block name="js"}
<script src="__INDEX__/stocks/stocks.js?v={$v}" type="text/javascript"></script>
{/block}